// https://umijs.org/config/
import { defineConfig } from 'umi';

import defaultSettings from './defaultSettings';
import proxy from './proxy';
import routes from './routes';

export default defineConfig({
  hash: true,
  antd: {},
  dva: {
    hmr: true,
  },
  nodeModulesTransform: {
    type: 'none',
    exclude: [],
  },
  layout: {
    // https://umijs.org/zh-CN/plugins/plugin-layout
    locale: true,
    siderWidth: 223,
    ...defaultSettings,
  },
  // https://umijs.org/zh-CN/plugins/plugin-locale
  locale: {
    // default zh-CN
    default: 'zh-CN',
    antd: true,
    // default true, when it is true, will use `navigator.language` overwrite default
    baseNavigator: true,
  },
  dynamicImport: {
    loading: '@ant-design/pro-layout/es/PageLoading',
  },
  targets: {
    ie: 11,
  },
  // umi routes: https://umijs.org/docs/routing
  routes,
  access: {},
  //   Theme for antd: https://ant.design/docs/react/customize-theme-cn
  theme: {
    'primary-color': defaultSettings.primaryColor,
  },

  title: false,
  ignoreMomentLocale: true,
  proxy: proxy['dev'],

  //umi build配置
  manifest: {
    basePath: '/admin', //给所有文件路径加前缀
  },

  exportStatic: {},
  esbuild: {},

  //编译配置
  history: {
    type: 'browser',
  },
  mfsu: {},
  webpack5: {},
  fastRefresh: {},
  workerLoader: {},
  base: '/admin',
});
